/*
 * @Author       : shenqing
 * @desc         : 公用方法类
 * @Date         : 2022-10-10 17:46:29
 * @LastEditTime : 2022-10-11 09:02:08
 * @LastEditors  : shenqing
 * @FilePath     : \questionnaire\src\services\util.js
 */

/**
 * 获取cookie
 */
export const getCookie = name => {
    var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)')
    var arr = document.cookie.match(reg)
    if (arr) {
        return unescape(arr[2])
    } else {
        return null
    }
}
/**
 * 判断对象是否为空
 */
export const isNullOrEntry = value => {
    if (
        value === null ||
        value === undefined ||
        value === '' ||
        JSON.stringify(value) === '{}' ||
        value.length === 0
    ) {
        return true
    } else {
        return false
    }
}
